#include <stdio.h>
#include <stdlib.h>

void def_itoa(int num, char *str, int size)
{
	int i=0;
	int tmp[256]={0};
	while(1)
	{
		tmp[i++] = (num % 10);
		num /= 10;
		if(num == 0)
		{
			break;
		}
	}
	int j=0;
	int k=0;
	for(j = i-1; j >= 0; j--)
	{
		str[k++] = tmp[j]+0x30;
	}
	printf("str is %s", str);
}
int main()
{
	int num = 10;
	char string[25]={0};
	char str[25]={0};
	itoa(num, string, 10);
	def_itoa(num, str, 10);
	printf("num is %d, string is %s, str is [%s]\n", num, string, str);
	system("pause");
	return 0;
	
}